home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / oilplatform_scripts.lua < prev    next >
Encoding:
Text File  |  2007-01-25  |  3.7 KB  |  106 lines

  1.  
  2. function units_oilplatform_setup()
  3.     building_setup(ENET_GEOMETRY_OILPLATFORM_SHADOW)
  4.     uniGetExecutor():getBone(ENBT_FAN,0):addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_OILPLATFORMFIRE)
  5. end
  6.  
  7. function units_oilplatform_resetup()
  8.     building_setup(ENET_GEOMETRY_OILPLATFORM_SHADOW)
  9.     uniGetExecutor():getBone(ENBT_FAN,0):addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_OILPLATFORMFIRE)
  10. end
  11.  
  12. function units_oilplatform_select()
  13.     units_select(12,1)
  14. end
  15.  
  16. function units_oilplatform_unselect()
  17.     units_unselect()
  18. end
  19.  
  20. function units_oilplatform_selectenemy()
  21.     uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
  22. end
  23.  
  24. function units_oilplatform_damaged()
  25.     uniGetExecutor():applyDamage(uniGetLife())
  26. end
  27.  
  28. function units_oilplatform_highlight()
  29.     uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
  30. end
  31.  
  32. function units_oilplatform_explode()
  33.     units_explode_oilplatform()
  34. end
  35.  
  36. function units_oilplatform_move()
  37. end
  38.  
  39. function units_oilplatform_fire()
  40. end
  41.  
  42. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_MOVE,"units_oilplatform_move")
  43. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_FIRE1,"units_oilplatform_fire")
  44. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_FIRE2,"units_oilplatform_fire")
  45. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_SELECT,"units_oilplatform_select")
  46. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_SELECTENEMY,"units_oilplatform_selectenemy")
  47. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_UNSELECT,"units_oilplatform_unselect")
  48. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_SETUP,"units_oilplatform_setup")
  49. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_RESETUP,"units_oilplatform_resetup")
  50. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_DAMAGED,"units_oilplatform_damaged")
  51. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_EXPLODE,"units_oilplatform_explode")
  52. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_HIGHLIGHT,"units_oilplatform_highlight")
  53. registerCommand(ENSCRIPTSET_OILPLATFORM,ENC_INSIDE,"units_inside")
  54.  
  55. -- make description of unit
  56. desc = getEffectDescriptionP(ENET_UNIT_OILPLATFORM)
  57. desc.ClassID = ENCLASS_MESHINSTANCE
  58. desc.EffectClassType = ENECT_GEOMETRY
  59. desc.FileName = "oilplatform.rmd"
  60. desc.ScriptSet = ENSCRIPTSET_OILPLATFORM
  61. desc.MoveType = ENMOVE_SWIM
  62. desc.RenderType = ENRENDERTYPE_GEOMETRY
  63. desc.Material = ENMAT_CAPITAL
  64. desc.MaterialColors = units_materialcolors_human
  65.  
  66. -- shadow
  67. desc = getEffectDescriptionP(ENET_GEOMETRY_OILPLATFORM_SHADOW)
  68. desc.ClassID = ENCLASS_MESHINSTANCE
  69. desc.EffectClassType = ENECT_GEOMETRY
  70. desc.FileName = "oilplatform_shadow.rmd"
  71. desc.RenderType = ENRENDERTYPE_SHADOW
  72. desc.Material = ENMAT_SHADOW
  73. desc.MaterialColors = units_materialcolors_shadow
  74.  
  75. -- register new unit to logic
  76. unitDesc = logic_getUnitDescP(56)
  77. unitDesc.group = 0
  78. unitDesc.order = 0
  79. unitDesc.unit_res_id = ENET_UNIT_OILPLATFORM
  80. unitDesc.unit_icon_id = "Smallrobot_h_small_normal.dds"
  81. unitDesc.active_id = "Smallrobot_h_small_active.dds"
  82. unitDesc.pressed_id = "Smallrobot_h_small_pressed.dds"
  83. unitDesc.big_icon_id = "Oilplatform_h_big_normal.dds"
  84. unitDesc.small_icon_id = "80A0.dds"
  85. unitDesc.HP = 4
  86. unitDesc.MP = 0
  87. unitDesc.WR = 0
  88. unitDesc.min_WR = 0
  89. unitDesc.WD = 0
  90. unitDesc.WR2 = 0
  91. unitDesc.min_WR2 = 0
  92. unitDesc.WD2 = 0
  93. unitDesc.ability = 3
  94. unitDesc.transport = 0
  95. unitDesc.value = 3
  96. unitDesc.race = 0
  97. unitDesc.fire_pause = 0.2
  98. unitDesc.move_pause = 0.5
  99. unitDesc.unit_info_scale = 0.08
  100. unitDesc.scn_name = "OILPLATFORM"
  101.  
  102. ------------------------------------------------------------------------------------------------------
  103. ------------------------ effects related to unit------------------------------------------------------
  104. ------------------------------------------------------------------------------------------------------
  105.  
  106.